package cn.edu.lingnan.tourism.service.Impl;

import cn.edu.lingnan.tourism.exeption.TourismException;
import cn.edu.lingnan.tourism.mapper.RouteMapper;
import cn.edu.lingnan.tourism.mapper.SellerMapper;
import cn.edu.lingnan.tourism.pojo.Route;
import cn.edu.lingnan.tourism.pojo.Seller;
import cn.edu.lingnan.tourism.service.SellerService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class SellerServiceImpl implements SellerService {
    @Resource
    private SellerMapper sellerMapper;
@Transactional(readOnly = true)
    @Override
    public Seller getSellerDetails(Integer sellerId) {
        return sellerMapper.getSellerDetails(sellerId);
    }
    @Transactional(readOnly = true)
    @Override
    public List<Route> getRoutesBySeller(Integer sellerId) {
        return sellerMapper.getRoutesBySellerId(sellerId);
    }
    @Transactional(readOnly = true)
    @Override
    public List<Seller> getAllSeller() {
        return sellerMapper.selectAll();
    }
    @Transactional(readOnly = true)
    @Override
    public Integer selectSellerCount() {
        return sellerMapper.selectSellerCount();
    }


}
